import Vue from 'vue'
import axios from 'axios'
Vue.prototype.$axios = axios    //全局注册
import Cookies from 'js-cookie'
import Viser from 'viser-vue'
import map from './utils/map.js'
import './utils/directives.js'
import mapnew from './utils/mapnew.js'
import './utils/Leaflet.AnimatedMarker.js'
import 'leaflet/dist/leaflet.css'
import './utils/MovingMarker.js'
import './utils/popupPlus'
import $ from 'jquery'
import layer from 'vue-layer'
import 'vue-layer/lib/vue-layer.css'
import 'leaflet-easybutton'
import 'leaflet-easybutton/src/easy-button.css'
Vue.prototype.$map=map
Vue.prototype.$mapnew=mapnew
Vue.prototype.$layer = layer(Vue);
Vue.use(Viser)

window.jQuery = $
window.$ = $
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import Element from 'element-ui'
import './styles/element-variables.scss'

// 导入font-awesome图标库
import 'font-awesome/css/font-awesome.min.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import socketIO from './socketIO'
import eventBus from './bus/bus'

import i18n from './lang' // Internationalization
import './icons' // icon
import './permission' // permission control
import './utils/errorLog' // error log

import * as filters from './filters' // global filters

// import { mockXHR } from '../mock' // simulation data

Vue.use(socketIO)
// mock api in github pages site build
// if (process.env.NODE_ENV === 'production') {
//   mockXHR()
// }

Element.Dialog.props.closeOnClickModal.default = false   //修改el-dialog 默认点击遮罩不关闭

Vue.use(Element)

// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

Vue.prototype.$bus = eventBus

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
